#ifndef FILE_BROWSER_H
#define FILE_BROWSER_H

#include <QWidget>
#include <QSplitter>
#include <QStandardItemModel>
#include <QTreeView>
#include <QTextCodec>
#include <QFileInfo>
#include <QDir>
#include <QSharedPointer>
#include <QMenu>
#include "../settings/config_file.h"
#include "editer_tab_widget.h"
#include "../unitls/mstandarditem.h"
#include "../unitls/unitls.h"
#include <QInputDialog>
#include <QSet>
#include <QList>

namespace Ui {
class File_Browser;
}

class File_Browser : public QWidget
{
    Q_OBJECT

public:
    explicit File_Browser(QWidget *parent = 0);
    ~File_Browser();
    void Init_UI();
private:
    Ui::File_Browser *ui;
public slots:
    void on_button_hide_clicked();
    void on_floder_setted(QString floder);
    void on_treeView_doubleClicked(QModelIndex file_inded);
    void resizeEvent(QResizeEvent *event);
    void slot_right_click_event(const QPoint &pos);
    void slot_rename_file();
    void slot_rename_dir();
    void slot_delete_file();
    void slot_delete_dir();
    void slot_remove_root_dir();
private:
    QString root_path;
    void get_floder_tree();
    QStandardItemModel* model;
    MStandardItem* tree_root_item;
    editer_tab_widget* editer;
    QList<MStandardItem*> child_list;
    int get_child_index_from_parent(QModelIndex parent, QString child_val) const;
    void Init_floder_tree(QString& path, MStandardItem* root=nullptr);

};

#endif // FILE_BROWSER_H
